package com.alasbusy.alasbusyapp;

import android.content.Context;
import com.alasbusy.alasbusyapp.dbutils.IntImp.ConfigureManager;
import com.alasbusy.alasbusyapp.dbutils.IntImp.RetrofitUtils;
import com.alasbusy.alasbusyapp.utils.HttpApiConst;
import com.alasbusy.highperformancefriendscirclelibrary.FriendsCircleApplication;

/**
 * Created by Administrator on 2018/5/11.
 */

public class AlasbusyApplication extends FriendsCircleApplication {
    public static Context context;
    private static AlasbusyApplication instance;
    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        init(context);
        instance = this;
        ConfigureManager.getConfigureManager().setOkhttpCache(true);//设置okhttp是否缓存
        RetrofitUtils.initRetrofit(HttpApiConst.kycxkBaseDomain);

    }

    public static AlasbusyApplication getInstance() {
        if (instance == null) {
            throw new NullPointerException("WinApplication instance is null, please register in AndroidManifest.xml first");
        }
        return instance;
    }

    /**
     * 获取上下文
     *
     * @return Context
     */
    public static Context getContext() {
        return context;
    }
}